package com.training.java.core.equals;



/**
 * The purpose of this class is to observe how the equals compare 2 strings.
 * 
 */


public class Car {
	
	private String vinNumber ;
	private String make;
	private String model;
	
	
	//Creating the constructor
	
	public Car(String vinNumber, String make,String model)
	
	{
		this.vinNumber = vinNumber;
		this.make=make;
		this.model=model;
	}
	
	
	//Here the requirement is "If vinNumbers are equal the cars are equal"
	@Override
	public boolean equals(Object obj) {
		
		Car that = (Car) obj; // Casting
		return this.vinNumber.equals(that.vinNumber);
		
	}
	}
	
	
	



